package com.bc.bczbweb.controller;

import com.bc.bccore.zbconfig.ZbConfig;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Name BaseController
 * @Description
 * @Author douhaichao
 * @Date 2018/7/5 18:52
 * @Version 1.0
 **/
public class BaseController {
    public ModelAndView baseView(String title, String viewPath) {
        ModelAndView view = new ModelAndView("web_view");
        view.addObject("title", title);
        view.addObject("viewPath", viewPath);
        view.addObject("basePath", ZbConfig.getSitePath());
        view.addObject("staticVersion", ZbConfig.getStaticVersion());
        view.addObject("defaultPageSize", ZbConfig.getDefaultPageSize());
        view.addObject("staticPath", ZbConfig.getStaticSitePath());
        view.addObject("imgurl", ZbConfig.getImgUrl());
        return view;
    }

    public ModelAndView baseViewAjax(String title, String viewPath) {
        ModelAndView view = new ModelAndView(viewPath);
        view.addObject("basePath", ZbConfig.getSitePath());
        view.addObject("accountStaticPath", ZbConfig.getAccountStaticPath());
        view.addObject("staticVersion", ZbConfig.getStaticVersion());
        view.addObject("staticPath", ZbConfig.getStaticSitePath());
//        view.addObject("loginClient", userAccountService.loginClient());
        return view;
    }
}
